import request from '@/utils/request';

const processService = {
    // 月模板提交时流程页面数据
    async queryTemplateProcessModel(organizationCode, year) {
        return request(`/api/finance/salary/v1/salaryTemplate/next/${organizationCode}/${year}`, {
            method: 'GET'
        });
    },
    // 月模板提交后流程页面数据
    async queryTemplateProcessDetail(year) {
        return request(`/api/finance/salary/v1/salaryTemplate/approve/info/${year}`, {
            method: 'GET'
        });
    },
    // 版本审批确认 -> 王耀辉
    async submitTemplateProcess(postData) {
        return request('/api/finance/salary/v1/salaryTemplate/approve/confirm', {
            method: 'POST',
            data: postData
        });
    },

    // 审批通过与拒绝 -> 王耀辉
    async approveSalaryTemplateProcess(postData) {
        return request(`/api/finance/salary/v1/salaryTemplate/approve/status/${postData.year}/${postData.status}`, {
            method: 'GET'
        });
    },

    // 月模板提交流程页面数据
    async querySalaryPaySettingProcessModel(organizationCode) {
        return request(`/api/finance/salary/v1/salarySet/grant/next/${organizationCode}`, {
            method: 'GET'
        });
    },

    // 参数设置-薪资发放设置提交
    async submitSalarySettingProcess(params) {
        return request('/api/finance/salary/v1/salarySet/approve/confirm', {
            method: 'POST',
            data: {
                ...params
            }
        });
    },

    // 月模板提交后流程页面数据
    async querySalaryPaySettingDetail() {
        return request('/api/finance/salary/v1/salarySet/approve/info', {
            method: 'GET'
        });
    },

    // 版本审批确认 -> 王耀辉
    async approveSalaryPaySettingProcess(postData) {
        return request(`/api/finance/salary/v1/salarySet/approve/status/${postData.status}`, {
            method: 'GET'
        });
    },

    // 城市医社保档案--下一步 -> 陈炎彬
    async queryMedicalSocialModel(postData) {
        return request(`/api/finance/salary/v1/setting/social/next/step/${postData.socialId}`, {
            method: 'GET'
        });
    },

    // 个税预扣率--下一步 -> 陈炎彬
    async queryPersonalIncomeModel(postData) {
        return request(`/api/finance/salary/v1/setting/tax/next/step/${postData.taxRateId}`, {
            method: 'GET'
        });
    },

    // 技能发展税 -下一步
    async queryNextStepSdl({ sdlId }) {
        return request(`/api/finance/salary/v1/setting/sdl/nextStep/${sdlId}`, {
            method: 'GET'
        });
    },

    // CPF档案-下一步 -> 陈炎彬
    async queryCPFModel (postData) {
        return request(`/api/finance/salary/v1/setting/cpf/nextStep/${postData.cpfId}`, {
            method: 'GET'
        });
    }
};

export { processService };
